local skill = fk.CreateSkill{
    name = "roulette_adrenaline_skill",
}
Fk:loadTranslationTable{
    ["#roulette_adrenaline_skill"] = "是否使用 肾上腺素，获得一名角色一张手牌并立即使用",
}
skill:addEffect("cardskill",{
    prompt = "#roulette_adrenaline_skill",
    mod_target_filter = function(self, player, to_select, selected, card, extra_data)
        return to_select and to_select ~= player and #table.filter(to_select.player_cards[Player.Hand],function (cardID)
            local c = Fk:getCardById(cardID)
            return c.name ~= "roulette_adrenaline"
        end) > 0
    end,
    target_filter = Util.CardTargetFilter,
    target_num = 1,
    on_effect = function(self, room, effect)
        if effect.from.dead or effect.to.dead or #table.filter(effect.to.player_cards[Player.Hand],function (cardID)
            local c = Fk:getCardById(cardID)
            return c.name ~= "roulette_adrenaline"
        end) == 0 then return end
        local cid = room:askToChooseCard(effect.from, { target = effect.to, flag = {
            card_data = {
                {"$Hand",table.filter(effect.to.player_cards[Player.Hand],function (cardID)
                    local c = Fk:getCardById(cardID)
                    return c.name ~= "roulette_adrenaline"
                end)}
            }
        }, skill_name = skill.name })
        room:obtainCard(effect.from, cid, false, fk.ReasonPrey, effect.from, skill.name)
        if effect.from.id > 0 then
            room:askToUseRealCard(effect.from,{
                pattern = {cid},
                cancelable = false,
                skill_name = skill.name
            })
        else
            local tempc = Fk:getCardById(cid)
            if effect.from:canUseTo(tempc,effect.from) then
                room:useCard{ from = effect.from, card = tempc, tos = {effect.from} }
            else
                local targets = table.filter(room.alive_players,function (cp)
                    return effect.from:canUseTo(tempc,cp)
                end)
                if #targets > 0 then
                    room:useCard{ from = effect.from, card = tempc, tos = {table.random(targets)} }
                end
            end
        end
    end,
})
return skill